#include<iostream>
#include<vector>
#include<string>

using namespace std;

class Solution {
public:
	vector<vector<string>> partition(string s) {
		vector<vector<string>> res;
		backtrack(s, res, {});
		return res;
	}
	void backtrack(string s, vector<vector<string>>& res, vector<string> path) {
		if (s.size() == 0) {
			res.push_back(path);
			return;
		}
		for (int i = 1; i <= s.size(); i++) {
			string pre = s.substr(0, i);
			if (isPalindrome(pre)) {
				path.push_back(pre);
				backtrack(s.substr(i), res, path);
				path.pop_back();
			}
		}
	}
	bool isPalindrome(string s) {
		if (s.size() <= 1) return true;
		int start = 0, end = s.size() - 1;
		while (start < end) {
			if (s[start] != s[end])
				return false;
			start++;
			end--;
		}
		return true;
	}
};

int main() {
	string s = "123";
	cout << s.substr(1) << endl;
}